import 'package:flutter/material.dart';

class CustomScrollViewdemo extends StatefulWidget {
  CustomScrollViewdemo({Key key}) : super(key: key);

  _CustomScrollViewdemoState createState() => _CustomScrollViewdemoState();
}

class _CustomScrollViewdemoState extends State<CustomScrollViewdemo> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new CustomScrollView(
        slivers: [
          new SliverToBoxAdapter(
            child: new Container(height: 100.0, color: Colors.blueAccent),
          ),
          new SliverList(
            delegate: new SliverChildListDelegate(
              new List<Widget>.generate(20, (int index) {
                return new Text(
                  'Item $index',
                  style: new TextStyle(fontSize: 42.0),
                );
              }),
            ),
          ),
          new SliverToBoxAdapter(
            child: new Container(height: 100.0, color: Colors.tealAccent),
          ),
        ],
      ),
    );
  }
}
